<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>JC小站 - 与你共享生活和今日份的丧</title><meta name="author" content="John Cena"><meta name="copyright" content="John Cena"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="梦想不大,道路漫长">
<meta property="og:type" content="website">
<meta property="og:title" content="JC小站">
<meta property="og:url" content="https://jcxiaozhan.gitee.io/index.html">
<meta property="og:site_name" content="JC小站">
<meta property="og:description" content="梦想不大,道路漫长">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://jcxiaozhan.gitee.io/mysrc/headimg.jpg">
<meta property="article:author" content="John Cena">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://jcxiaozhan.gitee.io/mysrc/headimg.jpg"><link rel="shortcut icon" href="https://img.jcxiaozhan.top/%E7%BD%91%E7%AB%99%E5%B0%8F%E5%9B%BE%E6%A0%87.png"><link rel="canonical" href="https://jcxiaozhan.gitee.io/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"/search.xml","preload":false,"languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: {"limitCount":50,"languages":{"author":"作者: John Cena","link":"链接: ","source":"来源: JC小站","info":"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"top-right"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: true,
  islazyload: false,
  isAnchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'JC小站',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2024-02-10 20:53:14'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
          const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
          const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
          const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified

          if (t === undefined) {
            if (isLightMode) activateLightMode()
            else if (isDarkMode) activateDarkMode()
            else if (isNotSpecified || hasNoSupport) {
              const now = new Date()
              const hour = now.getHours()
              const isNight = hour <= 6 || hour >= 18
              isNight ? activateDarkMode() : activateLightMode()
            }
            window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
              if (saveToLocal.get('theme') === undefined) {
                e.matches ? activateDarkMode() : activateLightMode()
              }
            })
          } else if (t === 'light') activateLightMode()
          else activateDarkMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/css/mycss.css"><meta name="generator" content="Hexo 6.2.0"><link rel="alternate" href="/atom.xml" title="JC小站" type="application/atom+xml">
</head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/mysrc/headimg.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">33</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">17</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/artitalk/index.html"><i class="fa-fw fa-fw far fa-comments"></i><span> 说说</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group hide" href="javascript:void(0);"><i class="fa-fw fas fa-link"></i><span> 链接</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fa fa-users"></i><span> 友情链接</span></a></li><li><a class="site-page child" href="/sites/"><i class="fa-fw fa fa-bookmark"></i><span> 实用网站</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/navigation.html"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://api.vvhan.com/api/bing')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">JC小站</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/artitalk/index.html"><i class="fa-fw fa-fw far fa-comments"></i><span> 说说</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page group hide" href="javascript:void(0);"><i class="fa-fw fas fa-link"></i><span> 链接</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/link/"><i class="fa-fw fa fa-users"></i><span> 友情链接</span></a></li><li><a class="site-page child" href="/sites/"><i class="fa-fw fa fa-bookmark"></i><span> 实用网站</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/navigation.html"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">JC小站</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="https://github.com/jcxiaozhan0403" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="http://wpa.qq.com/msgrd?v=3&amp;uin=349636607&amp;site=qq&amp;menu=yes" target="_blank" title="QQ"><i class="fab fa-qq"></i></a><a class="social-icon" href="mailto:349636607@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/2020/03/04/%E5%BB%BA%E7%AB%99%E6%84%9F%E8%A8%80/" title="建站感言"><img class="post_bg" src="https://img.jcxiaozhan.top/cover/%E7%BD%91%E7%AB%99%E5%BB%BA%E8%AE%BE.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="建站感言"></a></div><div class="recent-post-info"><a class="article-title" href="/2020/03/04/%E5%BB%BA%E7%AB%99%E6%84%9F%E8%A8%80/" title="建站感言">建站感言</a><div class="article-meta-wrap"><span class="article-meta"><i class="fas fa-thumbtack sticky"></i><span class="sticky">置顶</span><span class="article-meta-separator">|</span></span><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-03-03T16:00:00.000Z" title="发表于 2020-03-04 00:00:00">2020-03-04</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%BD%91%E7%AB%99%E5%BB%BA%E8%AE%BE/">网站建设</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E7%BD%91%E7%AB%99%E5%BB%BA%E8%AE%BE/">网站建设</a></span></div><div class="content">前言历时两个月，我的博客终于在今天基本完成了，此时此刻，我，除了激动还是激动，现网站有了评论点赞第三方登录这些基本的功能，美化和优化都还存在很多问题，等后期一步一步来吧，对于网站搭建，我后面会写几篇文章，专门讲解。

本站历程
2020.3.4 首次搭建个人网站成功，采用阿里云学生机(ContOS系统)+wordpress框架搭建
2020.9.12 网站搬迁,现目前网站采用Gitee+Hexo框架搭建

因为服务器要花上一笔不少的费用，所以才花了大量时间搭建了现在这个免费博客，在这里也十分感谢网络上默默奉献的大佬，成熟的框架体系和已完善的功能让我们这些小白搭站的过程变得更加方便。
建站初衷我为什么会搭建网站呢？这个…说来话长…
刚转专业的我，在班级群看见老师叫每人租一个云服务器，把他们上学期的静态网页通上网，于是，什么都不懂的我，就跟个憨憨一样，买了一年的服务器，打开了B站，搜索了网站搭建，后来我才知道，网站搭建跟静态网页通网，那是两个概念。
总之，在历经九九八十一难之后，我的小站还是搭建起来了，也是在搭建过程中，我了解到了技术博客这个东西，据说，每一个优秀的程序员都应该拥有一个自己 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2023/12/31/2023%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="2023年终总结"><img class="post_bg" src="https://img.jcxiaozhan.top/cover/2023%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="2023年终总结"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/12/31/2023%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="2023年终总结">2023年终总结</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2023-12-30T16:00:00.000Z" title="发表于 2023-12-31 00:00:00">2023-12-31</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%94%9F%E6%B4%BB%E7%90%90%E7%A2%8E/">生活琐碎</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/">年终总结</a></span></div><div class="content">前言新年已至，当我站在时光的分水岭，回首过去，思考着这一年的点点滴滴，心中充满了感慨与期待。在这特殊的时刻，我想分享一下我自己的年终总结，感叹时光的匆匆流转，也为未来充满信心。 这一年，我经历了许多挑战和变化，每一次的起伏都让我更加坚定前行的步伐。有时的辛劳，是为了更好的明天；有时的坚持，是为了追逐内心的梦想。岁月的打磨，让我看清了自己的成长，也教会我珍惜当下的每一个瞬间。 新年伊始，我心怀感激，感激这一年来所受到的一切。有困难让我更加坚韧，有挑战让我更加勇敢。每一份努力都是值得的，每一次坚持都是有意义的。在新的一年里，我愿继续保持对生活的热爱，继续为梦想努力拼搏。我怀揣着对未来的美好期许，愿这一年充满希望、充满阳光。
校园时光我人生最后的校园时光，正是我的大三下半期。网络上充斥着关于互联网行业寒冬和Java已死的言论。从大三开学开始，我就感到非常焦虑，不愿意听课，整天埋头于枯燥的八股文中，在我看来，上课阻碍了我找工作。同时，课堂上也有很多埋头自学的同学，大家各为前程。应试教育的大环境下，即使你考试考得再好，如果专业技能无法满足企业的需求，也难以找到满意的工作，这是一个颇具讽刺意味的现 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2023/02/22/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%EF%BC%9AJVM%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90/" title="从零开始：JVM原理解析"><img class="post_bg" src="https://img.jcxiaozhan.top/cover/Java.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="从零开始：JVM原理解析"></a></div><div class="recent-post-info"><a class="article-title" href="/2023/02/22/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%EF%BC%9AJVM%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90/" title="从零开始：JVM原理解析">从零开始：JVM原理解析</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2023-02-21T16:00:00.000Z" title="发表于 2023-02-22 00:00:00">2023-02-22</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%BC%96%E7%A8%8B%E5%AD%A6%E4%B9%A0/">编程学习</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Java/">Java</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/JVM/">JVM</a></span></div><div class="content">JVM是什么JVM 是 Java Virtual Machine 的缩写，是 Java 程序的运行环境。它是一个虚拟的计算机，在实际的计算机上运行，它通过将 Java 字节码解释或编译为机器码来执行 Java 程序。
JVM 有自己完善的硬体架构，如处理器、堆栈、寄存器等，还具有相应的指令系统，它屏蔽了与具体操作系统平台相关的信息。
Java的跨平台实现Java 语言的跨平台特性就是依靠 JVM 来实现的。就像我们日常所使用的一些应用程序一样，针对不同的操作系统，有不同版本的 JVM ，我们只需要进行相应的安装配置即可
Java 源代码文件通过编译之后，产生的以 .class 结尾的字节码文件可以直接运行在 JVM 上面，从而实现跨平台，同一份字节码文件通过 JVM，可以不加修改就运行在不同操作系统上，也就是所说的 一次编译，处处运行。

JVM内存结构JVM 的运行时数据区分为：方法区、堆、栈、本地方法栈、程序计数器

方法区方法区只是一个逻辑上的概念，随着 JDK 的更新，具体实现如下，参考：方法区、永久代、元空间的区别



JDK 版本
方法区的实现
运行时常量池的位置



 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/12/31/2022%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="2022年终总结"><img class="post_bg" src="https://img.jcxiaozhan.top/cover/2022%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="2022年终总结"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/12/31/2022%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="2022年终总结">2022年终总结</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-12-30T16:00:00.000Z" title="发表于 2022-12-31 00:00:00">2022-12-31</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%94%9F%E6%B4%BB%E7%90%90%E7%A2%8E/">生活琐碎</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/">年终总结</a></span></div><div class="content">前言新的一年又到来了，还是像以往一样，给这魔幻的2022年做个小结吧。2022不长，在封控、摆烂以及无意义的忙碌中匆忙度过了。
2022目标回顾

深入学习SSM，源码分析
深入学习SpringBoot，源码分析
学习Spring Cloud，接触微服务
学习JVM课程
学习Vue课程
系统学习计网知识
学习RabbitMQ


看了看，也就完成了前三项吧，说是源码分析，其实也只是学习了它们的启动流程、一些加载机制而已。
虽然剩下的四项没有完成，但是接触学习了一些别的东西，比如MybatisPlus、Redis、Docker，由于简单的学习笔记我认为不是很有价值，故没有再单独整理成博客文章，可能之后进行进阶学习的时候，会写一些文章。
简单来说，就是2022学习目标没有达成。。。
上岸&amp;感受在经历了长达半年时间的备考后，我终于如愿考上了我们专业对口的公办本科院校，得以继续我的学习生涯。
但通过这一学期本科课程的学习，我还是挺失望的，学校开设的课程千奇百怪，每天都忙碌于没意义的实验作业，对，就是没意义，我不能理解为什么软件工程专业要把PS当做主修课程来学习。
但是我能够很好地分清主 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/11/29/%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE%E7%AE%97%E6%B3%95/" title="二分查找算法"><img class="post_bg" src="https://img.jcxiaozhan.top/cover/%E7%AE%97%E6%B3%95.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="二分查找算法"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/11/29/%E4%BA%8C%E5%88%86%E6%9F%A5%E6%89%BE%E7%AE%97%E6%B3%95/" title="二分查找算法">二分查找算法</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-11-28T16:00:00.000Z" title="发表于 2022-11-29 00:00:00">2022-11-29</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%BC%96%E7%A8%8B%E5%AD%A6%E4%B9%A0/">编程学习</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Java/">Java</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/%E7%AE%97%E6%B3%95/">算法</a></span></div><div class="content">定义二分查找（Binary Search）也叫作折半查找。是一种时间复杂度为O(logN)的查找算法

力扣

视频讲解


前提&amp;场景二分查找有两个要求，一个是数列有序（一般为升序排列），另一个是数列使用顺序存储结构（比如数组）
算法分析最开始以整个数组为区间，找到区间的中间元素，与目标元素进行比对。根据比对结果调整区间边界，再次找到区间的中间元素，与目标元素进行比对，如此循环，直至找到目标元素为止。
动画演示



注意点
区间的划分要清晰
在编码时根据区间的定义来设置边界值

编码实现左闭右闭区间思路
[left,right]

123456789101112131415161718192021222324class Solution &#123;    public int search(int[] nums, int target) &#123;        //避免当target小于nums[0]或大于nums[nums.length - 1]时多次循环运算        if (target &lt; nums[0] || target &gt; nums[nu ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2022/07/03/%E5%86%99%E7%BB%99%E4%BA%94%E5%B9%B4%E5%90%8E%E7%9A%84%E8%87%AA%E5%B7%B1%E7%9A%84%E4%B8%80%E5%B0%81%E4%BF%A1/" title="写给五年后的自己的一封信"><img class="post_bg" src="https://img.jcxiaozhan.top/cover/%E7%BB%99%E6%9C%AA%E6%9D%A5%E7%9A%84%E4%B8%80%E5%B0%81%E4%BF%A1.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="写给五年后的自己的一封信"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/07/03/%E5%86%99%E7%BB%99%E4%BA%94%E5%B9%B4%E5%90%8E%E7%9A%84%E8%87%AA%E5%B7%B1%E7%9A%84%E4%B8%80%E5%B0%81%E4%BF%A1/" title="写给五年后的自己的一封信">写给五年后的自己的一封信</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-07-02T16:00:00.000Z" title="发表于 2022-07-03 00:00:00">2022-07-03</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%94%9F%E6%B4%BB%E7%90%90%E7%A2%8E/">生活琐碎</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E4%BA%BA%E7%94%9F%E8%A7%84%E5%88%92/">人生规划</a></span></div><div class="content">
  66b46b7b58be19db62a6a8f28aae2f8a9259bd66cb3800c0d05a08a177e1dd20dc7f2c6b600ebd348401af779e147ffc72d3564a182250a8afd2dc45f93cd1d80f4e4a18a9560ed2d0600d699589ca8858ab4948a343a4be1fae4f8426faf80f7d10abc8332dad0039c94249ea9d51b3448b77712ac8cf3dd60b4376a1a812d0e15ff12daf62da4b403940f389521c9e2ec7b62f77e89fa0e5d94a079084824001113c6aba2c70ece226f1d6d0d13cb37c26d2d3a0bc4e84387f4ca76618df97e83f8853eebce48de38e265b91da7c965ebd79396a1090ed0731d3c54589daf42487ba308a2c95b85fc76df9921710889474c34a9a24b1ba1 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2022/06/13/%E4%B8%93%E5%8D%87%E6%9C%AC%E7%BB%8F%E9%AA%8C%E5%88%86%E4%BA%AB/" title="专升本经验分享"><img class="post_bg" src="https://img.jcxiaozhan.top/cover/%E4%B8%93%E5%8D%87%E6%9C%AC%E7%BB%8F%E9%AA%8C%E5%88%86%E4%BA%AB.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="专升本经验分享"></a></div><div class="recent-post-info"><a class="article-title" href="/2022/06/13/%E4%B8%93%E5%8D%87%E6%9C%AC%E7%BB%8F%E9%AA%8C%E5%88%86%E4%BA%AB/" title="专升本经验分享">专升本经验分享</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-06-12T16:00:00.000Z" title="发表于 2022-06-13 00:00:00">2022-06-13</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%94%9F%E6%B4%BB%E7%90%90%E7%A2%8E/">生活琐碎</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E4%B8%93%E5%8D%87%E6%9C%AC/">专升本</a></span></div><div class="content">前言
这篇文章是本人的专升本考试经验分享，我将会从我的角度出发尽可能详细地讲述我的专升本备考过程以及升本注意事项。这是对我人生经历的记录，同时也希望能帮助到后面有想要专升本的学弟学妹们，让你们少走一些弯路。


适用省份：四川省

个人简介四川信息职业技术学院2019级学生，高考调剂录取到新能源汽车专业，大一下期转专业到软件技术，在校期间专业成绩排名年级前二十的样子。
2022年参加专升本考试，考入成都工业学院软件工程专业，笔试总分195，总成绩70.75


关于备考关于专升本的备考，我觉得主要有以下几方面要注意：
报班or不报班这是在有专升本的想法之后第一个就应该考虑的问题，这个取决于个人。如果你的家庭根本不缺钱，那么请你直接报vip班，跟着老师学就好了，你甚至不需要浪费时间来看我这篇文章了；如果你的家庭条件一般，能够支付起几千到一万多不等的培训费用，你可以考虑报个班，培训班的老师会带着你系统地进行学习，人家老师的工作就是研究专升本考试的，所以请你不要质疑他们的专业性，当然也不是说报个班就能高枕无忧了，专升本考试决定因素还是个人的努力程度，如果你只是每天去培训班吹吹空调，那么还是别 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2021/12/31/2021%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="2021年终总结"><img class="post_bg" src="https://img.jcxiaozhan.top/cover/2021%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="2021年终总结"></a></div><div class="recent-post-info"><a class="article-title" href="/2021/12/31/2021%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="2021年终总结">2021年终总结</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-12-30T16:00:00.000Z" title="发表于 2021-12-31 00:00:00">2021-12-31</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%94%9F%E6%B4%BB%E7%90%90%E7%A2%8E/">生活琐碎</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/">年终总结</a></span></div><div class="content">前言2021走到年末，年终总结也就如约而至了，2021是短暂却又丰富多彩的一年，我呢，过得不算精彩，却也不赖。
今年参加了2次比赛，发表了10篇博客文章，29条博客说说，13条空间动态，9条朋友圈。
今年博客文章的数量和质量都不高，明年我一定会加倍努力，会用心地输出更加优质的博客文章。
空间动态明显减少，博客说说明显增加，渐渐学会了自己消化不良情绪。
历程第一名
在寒假期间举办的一个小型比赛取得了第一名的成绩，这个首先感谢晖哥给了我参加这次比赛的机会，其次感谢自己半个月的努力付出，最终还是有所收获。虽是小比赛，但是也足以在我空荡荡的简历上添上浓墨重彩的一笔了。

驾照
个人是挺不喜欢开车的，但是驾驶的确是当下每个年轻人都应该学习掌握的基础技能。磕磕绊绊、断断续续学了一个多学期，今年3月份终于把驾照拿到手了。

软件杯
4月底到6月底，停课两个月备赛“第十届中国软件杯”，遗憾的是，我们团队的能力欠缺太多，到最后也没有拿出一个像样的作品，这一仗，被打得稀碎。收获就是，提前接触、学习到了框架技术还有建模技术，培养了自学能力。

剑门关
在广元上学待了两年，周围全是景点，我都没去过，主要还是太 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/2021/11/10/%E8%BF%91%E5%86%B5/" title="近况"><img class="post_bg" src="https://img.jcxiaozhan.top/cover/%E8%BF%91%E5%86%B5.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="近况"></a></div><div class="recent-post-info"><a class="article-title" href="/2021/11/10/%E8%BF%91%E5%86%B5/" title="近况">近况</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-11-09T16:00:00.000Z" title="发表于 2021-11-10 00:00:00">2021-11-10</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%94%9F%E6%B4%BB%E7%90%90%E7%A2%8E/">生活琐碎</a></span></div><div class="content">上个月20号那天我参加了人生的第二个面试，boos直聘上面找到的，招一个全栈开发实习生，因为在学校写过几个项目，前后端我都写得还可以，我觉得应该能够胜任。收到面试邀请之后，我就过去了，去之前还花了整整一天时间，巩固复习了我的前端技术，就是为了到时候能和面试官侃侃而谈。到之后，我人蒙了，老板下楼接的我，我们来到一个办公室，有一张办公桌上摆了文件和电脑，那是他的办公桌，除此之外，还有四张空桌子，老板拿过我的简历，简单看了不到1分钟，开始跟我聊他的宏图大志，大概意思就是，需要开发一个款软件，所以他现在要招4个员工，嗯，后面就不用多说了吧，这是一家还在创业阶段的公司。
我的第二次面试就这样草草结束了，说实话，两次面试，我认为自己没有太多的收获，但我至少清楚了一点，像软件开发这个技术性很强的岗位，只要你技术足够到位，面试就会很轻松。从20号回来之后，我开始卷起来了了，早上7点我就起床去教室，每天下课后，在教室学到8点左右才回宿舍吃饭，吃完饭又开始学，学到十一二点的样子睡觉，第二天又重复，周末也是如此。就这样卷了5天，这5天我学完了一套springboot的课程，还顺带把ssm框架的课程又复习了一 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/2021/10/18/PageHelper%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/" title="PageHelper的简单使用"><img class="post_bg" src="https://img.jcxiaozhan.top/cover/Mybatis.jpg" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="PageHelper的简单使用"></a></div><div class="recent-post-info"><a class="article-title" href="/2021/10/18/PageHelper%E7%9A%84%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8/" title="PageHelper的简单使用">PageHelper的简单使用</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-10-17T16:00:00.000Z" title="发表于 2021-10-18 00:00:00">2021-10-18</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%BC%96%E7%A8%8B%E5%AD%A6%E4%B9%A0/">编程学习</a></span><span class="article-meta tags"><span class="article-meta-separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Java/">Java</a><span class="article-meta-link">•</span><a class="article-meta__tags" href="/tags/Mybatis/">Mybatis</a></span></div><div class="content">简介
PageHelper是一款好用的开源免费的Mybatis第三方分页插件，点击访问



后端(SSM项目)注：这里只给出了关键部分代码，分页操作是通过对获取到的List集合进行二次封装实现的，具体请注意看Service层与Contoller层代码，其他代码未变动，按照业务逻辑正常编写即可

导入依赖1234567891011121314151617181920212223242526272829&lt;!-- Mybatis --&gt;&lt;dependency&gt;    &lt;groupId&gt;org.mybatis&lt;/groupId&gt;    &lt;artifactId&gt;mybatis&lt;/artifactId&gt;    &lt;version&gt;3.5.7&lt;/version&gt;&lt;/dependency&gt;&lt;dependency&gt;    &lt;groupId&gt;org.mybatis&lt;/groupId&gt;    &lt;artifactId&gt;mybatis-spring&lt;/ ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><span class="space">&hellip;</span><a class="page-number" href="/page/4/#content-inner">4</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/mysrc/headimg.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">John Cena</div><div class="author-info__description">梦想不大,道路漫长</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">33</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">17</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">4</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly"><i class="fab fa-github"></i><span>主题获取</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/jcxiaozhan0403" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="http://wpa.qq.com/msgrd?v=3&amp;uin=349636607&amp;site=qq&amp;menu=yes" target="_blank" title="QQ"><i class="fab fa-qq"></i></a><a class="social-icon" href="mailto:349636607@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">感谢来访，喜欢的话可以常来小站逛逛，不定期更新博客内容！</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/12/31/2023%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="2023年终总结">2023年终总结</a><time datetime="2023-12-30T16:00:00.000Z" title="发表于 2023-12-31 00:00:00">2023-12-31</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2023/02/22/%E4%BB%8E%E9%9B%B6%E5%BC%80%E5%A7%8B%EF%BC%9AJVM%E5%8E%9F%E7%90%86%E8%A7%A3%E6%9E%90/" title="从零开始：JVM原理解析">从零开始：JVM原理解析</a><time datetime="2023-02-21T16:00:00.000Z" title="发表于 2023-02-22 00:00:00">2023-02-22</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/2022/12/31/2022%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" title="2022年终总结">2022年终总结</a><time datetime="2022-12-30T16:00:00.000Z" title="发表于 2022-12-31 00:00:00">2022-12-31</time></div></div></div></div><div class="card-widget" id="card-newest-comments"><div class="item-headline"><i class="fas fa-comment-dots"></i><span>最新评论</span></div><div class="aside-list"><span>正在加载中...</span></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E7%94%9F%E6%B4%BB%E7%90%90%E7%A2%8E/"><span class="card-category-list-name">生活琐碎</span><span class="card-category-list-count">10</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E7%BC%96%E7%A8%8B%E5%AD%A6%E4%B9%A0/"><span class="card-category-list-name">编程学习</span><span class="card-category-list-count">13</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E7%BD%91%E7%AB%99%E5%BB%BA%E8%AE%BE/"><span class="card-category-list-name">网站建设</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E7%BD%91%E7%BB%9C%E6%8A%80%E6%9C%AF/"><span class="card-category-list-name">网络技术</span><span class="card-category-list-count">5</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/%E5%B9%B4%E7%BB%88%E6%80%BB%E7%BB%93/" style="font-size: 1.35em; color: rgb(100, 21, 118)">年终总结</a><a href="/tags/Git/" style="font-size: 1.35em; color: rgb(184, 198, 121)">Git</a><a href="/tags/Java/" style="font-size: 1.45em; color: rgb(185, 125, 119)">Java</a><a href="/tags/Hibernate/" style="font-size: 1.15em; color: rgb(115, 17, 187)">Hibernate</a><a href="/tags/JSON/" style="font-size: 1.15em; color: rgb(120, 17, 171)">JSON</a><a href="/tags/JavaScript/" style="font-size: 1.25em; color: rgb(115, 97, 81)">JavaScript</a><a href="/tags/Mybatis/" style="font-size: 1.25em; color: rgb(175, 41, 127)">Mybatis</a><a href="/tags/%E4%B8%93%E5%8D%87%E6%9C%AC/" style="font-size: 1.15em; color: rgb(78, 96, 160)">专升本</a><a href="/tags/%E7%AE%97%E6%B3%95/" style="font-size: 1.25em; color: rgb(26, 179, 171)">算法</a><a href="/tags/%E7%BD%91%E7%AB%99%E5%BB%BA%E8%AE%BE/" style="font-size: 1.35em; color: rgb(193, 88, 160)">网站建设</a><a href="/tags/Hexo/" style="font-size: 1.15em; color: rgb(168, 43, 170)">Hexo</a><a href="/tags/JVM/" style="font-size: 1.15em; color: rgb(62, 100, 156)">JVM</a><a href="/tags/%E4%BA%BA%E7%94%9F%E8%A7%84%E5%88%92/" style="font-size: 1.15em; color: rgb(90, 124, 94)">人生规划</a><a href="/tags/%E6%A5%9A%E7%95%99%E9%A6%99/" style="font-size: 1.15em; color: rgb(33, 125, 7)">楚留香</a><a href="/tags/Markdown/" style="font-size: 1.15em; color: rgb(46, 187, 75)">Markdown</a><a href="/tags/%E7%99%BE%E5%BA%A6%E4%BA%91/" style="font-size: 1.25em; color: rgb(200, 46, 122)">百度云</a><a href="/tags/PanDownload/" style="font-size: 1.15em; color: rgb(1, 73, 37)">PanDownload</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span><a class="card-more-btn" href="/archives/" title="查看更多">
    <i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/12/"><span class="card-archive-list-date">十二月 2023</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2023/02/"><span class="card-archive-list-date">二月 2023</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/12/"><span class="card-archive-list-date">十二月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/11/"><span class="card-archive-list-date">十一月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/07/"><span class="card-archive-list-date">七月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/06/"><span class="card-archive-list-date">六月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/12/"><span class="card-archive-list-date">十二月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/11/"><span class="card-archive-list-date">十一月 2021</span><span class="card-archive-list-count">1</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">33</div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">49k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2024-02-10T12:53:13.621Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer" style="background-image: url('https://api.vvhan.com/api/bing')"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2024 By John Cena</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">生活是个无赖，总毁掉所有的期待<br><span id="htmer_time"></span></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>function subtitleType () {
  fetch('https://v1.hitokoto.cn')
    .then(response => response.json())
    .then(data => {
      if (true) {
        const from = '出自 ' + data.from
        const sub = ["世人慌慌张张，不过是图碎银几两。"]
        sub.unshift(data.hitokoto, from)
        window.typed = new Typed('#subtitle', {
          strings: sub,
          startDelay: 300,
          typeSpeed: 150,
          loop: true,
          backSpeed: 50,
        })
      } else {
        document.getElementById('subtitle').innerHTML = data.hitokoto
      }
    })
}

if (true) {
  if (typeof Typed === 'function') {
    subtitleType()
  } else {
    getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
  }
} else {
  subtitleType()
}
</script></div><script>window.addEventListener('load', () => {
  const changeContent = (content) => {
    if (content === '') return content

    content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[图片]') // replace image link
    content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[链接]') // replace url
    content = content.replace(/<pre><code>.*?<\/pre>/gi, '[代码]') // replace code
    content = content.replace(/<[^>]+>/g,"") // remove html tag

    if (content.length > 150) {
      content = content.substring(0,150) + '...'
    }
    return content
  }

  const getComment = () => {
    const runTwikoo = () => {
      twikoo.getRecentComments({
        envId: 'https://twikoo.jcxiaozhan.top/',
        region: '',
        pageSize: 5,
        includeReply: true
      }).then(function (res) {
        const twikooArray = res.map(e => {
          return {
            'content': changeContent(e.comment),
            'avatar': e.avatar,
            'nick': e.nick,
            'url': e.url + '#' + e.id,
            'date': new Date(e.created).toISOString()
          }
        })

        saveToLocal.set('twikoo-newest-comments', JSON.stringify(twikooArray), 10/(60*24))
        generateHtml(twikooArray)
      }).catch(function (err) {
        const $dom = document.querySelector('#card-newest-comments .aside-list')
        $dom.innerHTML= "无法获取评论，请确认相关配置是否正确"
      })
    }

    if (typeof twikoo === 'object') {
      runTwikoo()
    } else {
      getScript('https://cdn.staticfile.org/twikoo/1.6.8/twikoo.all.min.js').then(runTwikoo)
    }
  }

  const generateHtml = array => {
    let result = ''

    if (array.length) {
      for (let i = 0; i < array.length; i++) {
        result += '<div class=\'aside-list-item\'>'

        if (true) {
          const name = 'src'
          result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
        }
        
        result += `<div class='content'>
        <a class='comment' href='${array[i].url}' title='${array[i].content}'>${array[i].content}</a>
        <div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
        </div></div>`
      }
    } else {
      result += '没有评论'
    }

    let $dom = document.querySelector('#card-newest-comments .aside-list')
    $dom.innerHTML= result
    window.lazyLoadInstance && window.lazyLoadInstance.update()
    window.pjax && window.pjax.refresh($dom)
  }

  const newestCommentInit = () => {
    if (document.querySelector('#card-newest-comments .aside-list')) {
      const data = saveToLocal.get('twikoo-newest-comments')
      if (data) {
        generateHtml(JSON.parse(data))
      } else {
        getComment()
      }
    }
  }

  newestCommentInit()
  document.addEventListener('pjax:complete', newestCommentInit)
})</script><script src="/js/myjs.js"></script><canvas class="fireworks" mobile="false"></canvas><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/fireworks.min.js"></script><script id="canvas_nest" defer="defer" color="0,0,255" opacity="0.7" zIndex="-1" count="99" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-nest.min.js"></script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors = ["head > title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"]

var pjax = new Pjax({
  elements: 'a:not([target="_blank"]):not([href="/shuoshuo/"]):not([href="/navigation.html"]):not([href="/artitalk/index.html"])',
  selectors: pjaxSelectors,
  cacheBust: false,
  analytics: false,
  scrollRestoration: false
})

document.addEventListener('pjax:send', function () {

  // removeEventListener scroll 
  window.tocScrollFn && window.removeEventListener('scroll', window.tocScrollFn)
  window.scrollCollect && window.removeEventListener('scroll', scrollCollect)

  typeof preloader === 'object' && preloader.initLoading()
  document.getElementById('rightside').style.cssText = "opacity: ''; transform: ''"
  
  if (window.aplayers) {
    for (let i = 0; i < window.aplayers.length; i++) {
      if (!window.aplayers[i].options.fixed) {
        window.aplayers[i].destroy()
      }
    }
  }

  typeof typed === 'object' && typed.destroy()

  //reset readmode
  const $bodyClassList = document.body.classList
  $bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')

  typeof disqusjs === 'object' && disqusjs.destroy()
})

document.addEventListener('pjax:complete', function () {
  window.refreshFn()

  document.querySelectorAll('script[data-pjax]').forEach(item => {
    const newScript = document.createElement('script')
    const content = item.text || item.textContent || item.innerHTML || ""
    Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
    newScript.appendChild(document.createTextNode(content))
    item.parentNode.replaceChild(newScript, item)
  })

  GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()

  typeof chatBtnFn === 'function' && chatBtnFn()
  typeof panguInit === 'function' && panguInit()

  // google analytics
  typeof gtag === 'function' && gtag('config', '', {'page_path': window.location.pathname});

  // baidu analytics
  typeof _hmt === 'object' && _hmt.push(['_trackPageview',window.location.pathname]);

  typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()

  // prismjs
  typeof Prism === 'object' && Prism.highlightAll()

  typeof preloader === 'object' && preloader.endLoading()
})

document.addEventListener('pjax:error', (e) => {
  if (e.request.status === 404) {
    pjax.loadUrl('/404.html')
  }
})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>